﻿Imports System.Data.Entity

Public Class QlqaContext
    Inherits DbContext
    Public Sub New()

        MyBase.New("name=QLQA")
    End Sub
    Public Sub New(connectionString As String)
        MyBase.New(connectionString)
    End Sub


    Public Property Bans() As DbSet(Of Ban)
    Public Property ThanhViens() As DbSet(Of ThanhVien)
    Public Property DanhMucs() As DbSet(Of DanhMuc)
    Public Property SanPhams() As DbSet(Of SanPham)
    Public Property DonHangs() As DbSet(Of DonHang)
    Public Property ChiTietDonHangs() As DbSet(Of ChiTietDonHang)

    Protected Overrides Sub OnModelCreating(db As DbModelBuilder)
        ''  db.Entity(Of DonHang).HasRequired(Function(x) x.Ban).WithOptional(Function(x) x.DonHang)
    End Sub


End Class
